﻿using System;
using System.Data.Objects;
using System.Linq;
using Repository;

namespace DataGenerator.DefaultSets
{
    /// <summary>
    /// Generator emplementation
    /// </summary>
    public class PlaceTypeSet : SetBase<PlaceType>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PlaceTypeSet"/> class.
        /// </summary>
        /// <param name="objectSet">The object set.</param>
        public PlaceTypeSet(ObjectSet<PlaceType> objectSet)
            : base(objectSet)
        {
        }

        public PlaceType LectureAuditory
        {
            get { return Get(() => LectureAuditory); }
            set { Set(() => LectureAuditory, value); }
        }      
        
        public PlaceType Laboratory
        {
            get { return Get(() => Laboratory); }
            set { Set(() => Laboratory, value); }
        }       
        
        public PlaceType Auditory
        {
            get { return Get(() => Auditory); }
            set { Set(() => Auditory, value); }
        }      
        
        public PlaceType ComputerClass
        {
            get { return Get(() => ComputerClass); }
            set { Set(() => ComputerClass, value); }
        }       
        
        public PlaceType Stadium
        {
            get { return Get(() => Stadium); }
            set { Set(() => Stadium, value); }
        }

        /// <summary>
        /// Searches the default value.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>Default entity.</returns>
        protected override PlaceType SearchDefaultValue(string name)
        {
            return ObjectSet.FirstOrDefault(e => e.Name == name);
        }
    }
}
